import request from '@/utils/request'

// 发送消息
export function sendMessage(data) {
  return request({
    url: '/messages/send',
    method: 'post',
    data
  })
}

// 批量发送消息
export function batchSendMessage(data) {
  return request({
    url: '/messages/batch-send',
    method: 'post',
    data
  })
}

// 标记消息为已读
export function markMessageRead(id) {
  return request({
    url: `/messages/${id}/read`,
    method: 'post'
  })
}

// 批量标记消息为已读
export function batchMarkMessageRead(ids) {
  return request({
    url: '/messages/batch-read',
    method: 'post',
    data: ids
  })
}

// 删除消息
export function deleteMessage(id) {
  return request({
    url: `/messages/${id}`,
    method: 'delete'
  })
}

// 批量删除消息
export function batchDeleteMessage(ids) {
  return request({
    url: '/messages/batch',
    method: 'delete',
    data: ids
  })
}

// 获取消息列表
export function getMessageList(params) {
  return request({
    url: '/messages/list',
    method: 'get',
    params
  })
}

// 获取未读消息数量
export function getUnreadCount(receiverId) {
  return request({
    url: '/messages/unread-count',
    method: 'get',
    params: { receiverId }
  })
} 